|
|
|
|
|
|
|
Module Wipes.bas includes eight wipe routines that move the new image over the old one from left to right, upper left to lower right, top to bottom, and so forth. A ninth subroutine makes the new image start in the center of the old image and grow outward. You can see the complete source code for each of these subroutines on the CD-ROM. |
|
|
|
|
|
|
|
|
In a push, a new picture pushes the old one out of the way as it slides into view. The code to perform a push is similar to the code for a wipe. The difference is in the calls to BitBlt. Before displaying a new piece of the new image, the program moves the old picture over to make room. Instead of sliding over the old picture, this makes the new image appear to push the old one out of its way. |
|
|
|
 |
|
|
|
|
' Push pic_new onto pic_old from left to right. Public Sub PushLeftToRight( _
ByVal pic_new As PictureBox, _
ByVal pic_old As PictureBox, _
ByVal ms_per_frame As Long, _
ByVal pixels_per_frame As Integer)
Dim next_time As Long
Dim wid As Single
Dim hgt As Single
Dim X As Single
' Prevent more than one wipe at a time. If Wiping Then Exit Sub
Wiping = True
wid = pic_old.ScaleWidth
hgt = pic_old.ScaleHeight
' Start moving the image. X = 0
next_time = GetTickCount()
Do While X <= wid ' Move the existing area. BitBlt pic_old.hDC, X, 0, wid - X, hgt, _
pic_old.hDC, X - pixels_per_frame, 0, vbSrcCopy
' Copy the area. BitBlt pic_old.hDC, 0, 0, X, hgt, _
pic_new.hDC, wid - X, 0, vbSrcCopy
pic_old.Refresh
' Wait for the next frame's time. next_time = next_time + ms_per_frame
WaitTill next_time
X = X + pixels_per_frame |
|
|
|
|
|